package com.example.zwgt.yrfk.ui.risk.adapter;

import android.support.annotation.Nullable;
import android.support.v7.widget.AppCompatSpinner;
import android.widget.ArrayAdapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.zwgt.yrfk.R;
import java.util.List;

public class IndexDetailsAdapter extends BaseQuickAdapter<String,BaseViewHolder> {
    String[] arr={"18岁以下","18岁-30岁","31岁以上"};
    public IndexDetailsAdapter( @Nullable List<String> data) {
        super(R.layout.layout_index_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {

        helper.setText(R.id.tv_age,item);
        AppCompatSpinner spinner=helper.getView(R.id.spinner);
        ArrayAdapter<String> adapter= new ArrayAdapter<>(mContext, android.R.layout.select_dialog_item, arr);
        spinner.setAdapter(adapter);
    }
}
